import Blockly from 'blockly/core'
import 'blockly/python_compressed'
import 'blockly/blockly_compressed'
import 'blockly/blocks_compressed'

Blockly.Blocks.ast_Raw = {
  init: function () {
    this.appendDummyInput()
      .appendField("There're some errors.")
      .appendField(new Blockly.FieldTextInput('none'), 'wrongCode')
    this.setInputsInline(true)
    this.setPreviousStatement(true, null)
    this.setNextStatement(true, null)
    this.setColour(230)
    this.setTooltip('')
    this.setHelpUrl('')
  }
}

Blockly.Python.ast_Raw = function (block) {
  const textWrongcode = block.getFieldValue('wrongCode')
  const code = textWrongcode + '\n'
  return code
}

export default Blockly
